const { Schema, SchemaTypes } = require('../schema');
class Area extends Schema {
    PropertyModelDataTemplate () {
        return {
            areaName: {
                type: SchemaTypes.String,
                required: true
            },
            level: {
                type: SchemaTypes.Number,
                required: true
            },
            code: {
                type: SchemaTypes.String,
                required: false
            },
            parent: {
                type: SchemaTypes.ObjectId,
                required: false
            },

            createTime: {
                type: SchemaTypes.Number,
                required: true,
                default: require('../../module/tool/time').getCurrentTimestamp()
            },
            isEnable: {
                type: SchemaTypes.Boolean,
                required: true,
                default: false
            },
            isCharge: {
                type: SchemaTypes.Boolean,
                required: false,
                default: false,
                comment: '是否开启充值'
            },
            isWxPay: {
                type: SchemaTypes.Boolean,
                required: false,
                default: true,
                comment: '是否开启微信支付'
            },
            sort: {
                type: SchemaTypes.Number,
                required: true,
                default: 0
            }
        };
    }
}

module.exports = Area;
